package com.ls.pattern.adapter.v2.adapters;

import com.ls.pattern.adapter.ResultMsg;

/**
 * 请求登录适配器
 *
 * @author 挥之以墨
 */
public class LoginForTouTiaoAdapter extends BaseLoginAdapter implements ILoginOpenIdAdapter {

    @Override
    public boolean support(ILoginAdapter adapter) {
        return adapter instanceof LoginForTouTiaoAdapter;
    }

    @Override
    public ResultMsg login(String id, ILoginAdapter adapter) {
        if (!this.support(adapter)) {
            return null;
        }
        return super.loginForRegister(id, null);
    }

    @Override
    public ResultMsg loginForOpenId(String openId) {
        return this.login(openId, this);
    }
}
